Release 10.1A: OpenEdge Development:
ProDataSets


Defining FILL events

There are three levels of FILL events:

  1. Events for the ProDataSet itself.
  2. Events for one of the ProDataSet’s temp-table buffers.
  3. Events for each individual record created in a temp-table.

Because the FILL can apply (either explicitly or by cascading) to the whole ProDataSet or to individual temp-table buffers, there are separate events for each of those levels.

The ProDataSet is passed into each event procedure as an INPUT parameter BY-REFERENCE. This allows the event procedure to operate on the ProDataSet using static 4GL to reference its buffers and fields, without the ProDataSet being physically copied. This also means that because the ProDataSet is not copied, changes made to the ProDataSet by the event procedure are made to the same copy all procedures are using.

These are the FILL events for the ProDataSet and its members:

You use the SET-CALLBACK-PROCEDURE method to register each of these events for a ProDataSet handle or a ProDataSet buffer handle, which identifies the code to run for each object.

The lowest event level is for the individual record, fired once for each record created in each table during a FILL:

Figure 3–1 illustrates the order in which these nested events are triggered, using a single parent-child relationship as an example. Multiple levels of nesting would result in multiple levels of nesting of the events for each table. If there are multiple top-level tables, the process is repeated for each top-level table. Events for top-level tables are triggered in the order in which the tables are defined in the ProDataSet definition or added to a dynamic ProDataSet.

Figure 3–1: Trigger order for nested events

This is the sequence shown in Figure 3–1:

  1. The ProDataSet BEFORE-FILL event fires first, before any record reads begin.
  2. The table BEFORE-FILL event for the top-level table fires once before each row in that table is populated.
  3. A nested table BEFORE-FILL event fires once for each parent row, before any rows in the child table are populated.
  4. A BEFORE-ROW-FILL event fires once for each row in the table before it is populated, but after the corresponding records in the Data-Source have been read into their database buffers.
  5. An AFTER-ROW-FILL event fires once for each row in the table after it has been created and its field values assigned.
  6. The AFTER-FILL event on a nested table fires once for each parent row, after all the rows in the child table have been created and populated.
  7. The AFTER-FILL event on a parent table fires once for each parent row, after it and all of its children have been populated.
  8. The AFTER-FILL event on the ProDataSet itself fires last of all, when all rows have been populated.

Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095